<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/commons/taglibs.jsp" %>
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8">
	<script type="text/javascript" src="${ctx}/includes/officecontrol/OfficeContorlFunctions.js" charset="utf-8"></script>
</head>
<body onload='intializePage("${ctx}/swly.ppt")'>
	<form action="attach/browseDoc.do" method="post">
	
	<input type="hidden" id="fileName" name="fileName" value="${name}"/>
	<div id="officecontrol">
    	
    	<script type="text/javascript" src="${ctx}/includes/officecontrol/ntkoofficecontrol.js" charset="utf-8"></script>
    	<div id=statusBar style="height:20px;width:100%;background-color:#c0c0c0;font-size:12px;"></div>
			<script language="JScript" for=TANGER_OCX event="OnDocumentClosed()">
				setFileOpenedOrClosed(false);
			</script>
			<script language="JScript" for="TANGER_OCX" event="OnDocumentOpened(TANGER_OCX_str,TANGER_OCX_obj)">
				OFFICE_CONTROL_OBJ.SetReadOnly(true);
				OFFICE_CONTROL_OBJ.Menubar = false;
				OFFICE_CONTROL_OBJ.Menubar = false;
				OFFICE_CONTROL_OBJ.IsShowToolMenu = false;
				OFFICE_CONTROL_OBJ.IsShowEditMenu = false;
				//OFFICE_CONTROL_OBJ.Toolbars = false;
				//获取文档控件中打开的文档的文档类型
				switch(OFFICE_CONTROL_OBJ.doctype)
				{
					case 1:
						fileType = "Word.Document";
						fileTypeSimple = "wrod";
						break;
					case 2:
						fileType = "Excel.Sheet";
						fileTypeSimple="excel";
						break;
					case 3:
						fileType = "PowerPoint.Show";
						fileTypeSimple = "ppt";
						break;
					case 4:
						fileType = "Visio.Drawing";
						break;
					case 5:
						fileType = "MSProject.Project";
						break;
					case 6:
						fileType = "WPS Doc";
						fileTypeSimple="wps";
						break;
					case 7:
						fileType = "Kingsoft Sheet";
						fileTypeSimple="et";
						break;
					default :
						fileType = "unkownfiletype";
						fileTypeSimple="unkownfiletype";
				}
				setFileOpenedOrClosed(true);
			</script>
			<script language="JScript" for=TANGER_OCX event="BeforeOriginalMenuCommand(TANGER_OCX_str,TANGER_OCX_obj)">
				alert("BeforeOriginalMenuCommand事件被触发");
			</script>
			<script language="JScript" for=TANGER_OCX event="OnFileCommand(TANGER_OCX_str,TANGER_OCX_obj)">
				if (TANGER_OCX_str == 3) 
				{
					alert("不能保存！");
					CancelLastCommand = true;
					//saveFileToUrl();
				}
			</script>
    	</div>
    	<object classid="clsid:916EE952-83C7-485f-8469-69D975889ED2"    
		codebase="${ctx}/includes/officecontrol/ntkopdfdoc.cab#version=4,0,0,2" width="100%" height="100%"> 
		</object>
    </div>
    </form>
</body>
</html>
